package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import com.atguigu.springcloud.service.PaymentFeginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author admin
 * @title: OrderFeginController
 * @projectName cloud2021
 * @description: TODO
 * @date 2021/11/8 08:53
 */
@RestController
@Slf4j
public class OrderFeginController {

    @Resource
    private PaymentFeginService paymentFeginService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> get(@PathVariable("id") Long id){
        return paymentFeginService.getPaymentId(id);
    }


    @GetMapping("/consumer/payment/feign/timeout")
    public String paymentFeignTimeOut(){
        String serverPort = paymentFeginService.paymentFeignTimeOut();
        return serverPort;
    }

}
